package com.itheima.health.service.impl;

import com.itheima.health.mapper.UserMapper;
import com.itheima.health.pojo.User;
import com.itheima.health.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author spt
 * @description 用户服务实现类
 **/
@Slf4j
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public User findByUsername(String username) {
        //调用DAO查询数据
        return userMapper.selectByUsername(username);
    }

    @Override
    public String findmd5Password(String username) {
        //调用数据测过查询加盐密码
        String saltpassword = userMapper.findsaltPassword(username);
        return saltpassword;
    }
}
